package com.yunsuo.bean;

//调用搜索指纹python代码
public class TestThread extends Thread {
//    public void run(){
//        while(true){
//            //System.out.println("");
//            //System.out.println(SingletonLazy.getAddFinger());
//            if(SingletonLazy.getAddFinger()==0){
//                //System.out.println("调用搜索指纹python代码");
//                Identify.search();
//                try {
//                    Thread.sleep(1000);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }else{
//                try {
//                    //System.out.println("等待10秒=========================================================================");
//                    Thread.sleep(5000);
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//                //System.out.println("其他类会执行添加指纹python代码，此线程停止。");
//            }
//        }
//    }

    @Override
    public void run() {
        while(true){
            //Thread.sleep(100);
            int method=SingletonLazy.getInstance().getMethod();
            if(method==0){
                //System.out.println("use Identify fingerPrint");
                if(SingletonLazy.getInstance().P_IO()>-1){
                    //System.out.println("IO="+SingletonLazy.getInstance().getIOSource());
                    SingletonLazy.getInstance().getMethod();
                    //搜索指纹模块获得IO资源
                    //System.out.println("find IO");
                    //调用python代码
                    Identify.search();
                    //System.out.println("V_IO");
                    SingletonLazy.getInstance().V_IO();
                    //System.out.println("IO="+SingletonLazy.getInstance().getIOSource());
                }else{
                    //System.out.println("IO is not available");
                }
            }
        }
    }
}
